const mongoose = require('mongoose')

const schema = new mongoose.Schema({
  buyer: { type: mongoose.SchemaTypes.ObjectId, ref: 'Buyer' }, // 买家
  merchandise: { type: mongoose.SchemaTypes.ObjectId, ref: 'Merchandise' },
  size: { type: String },    // 尺码
  color: { type: String },   // 颜色
  number: { type: Number },  // 数量
  price: { type: Number },    // 价格
  img: { type: String },    // 图片
},{
  timestamps: true
})

module.exports = mongoose.model('Shopcar', schema)